import { Key } from '@/pages/CodeTables/specification';

// 第几行是否被选择
const selectedRowKeys = ref<Key[]>([]);
// 保存选择后的数据---需要向后端传递的数据
const selectStopwatch = ref<Object[]>([]);
// 按钮是否禁用
const hasSelected = computed(() => selectedRowKeys.value.length > 0);
const Deactivate = ref<boolean>(true);
// 勾选后将勾选数据插入数组
const onSelectChange = (e: Key[], record: Key[]) => {
  selectedRowKeys.value = e;
  selectStopwatch.value = record;
};
export function selectChangeHooks() {
  return {
    hasSelected,
    Deactivate,
    selectedRowKeys,
    selectStopwatch,
    onSelectChange,
  };
}
